package com.htgd.gardenexpo.service.impl;

import com.htgd.gardenexpo.entity.WxUserAchievement;
import com.htgd.gardenexpo.dao.WxUserAchievementMapper;
import com.htgd.gardenexpo.service.IWxUserAchievementService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

/**
 * <p>
 * 微信用户获得的成就 服务实现类
 * </p>
 *
 * @author author
 * @since 2024-12-19
 */
@Service
public class WxUserAchievementServiceImpl extends ServiceImpl<WxUserAchievementMapper, WxUserAchievement> implements IWxUserAchievementService {

    @Override
    public int getNumByOpenId(String openId) {
        Long count = lambdaQuery().eq(WxUserAchievement::getOpenId, openId)
                .count();
        return Math.toIntExact(count);
    }
}
